package com.example.smart.ui.fragment

import android.os.Bundle
import android.view.View
import com.example.lib.constants.JumpConstants
import com.example.lib.extend.getArgumentInt
import com.example.smart.R
import com.example.smart.base.ui.fragment.BaseFragment
import com.example.smart.databinding.FragRankBinding

class RankFragment : BaseFragment<FragRankBinding>() {
    private var type = 0

    companion object {
        fun getInstance(type: Int): RankFragment {

            return RankFragment().also {
                it.arguments = Bundle().also { arg ->
                    arg.putInt(JumpConstants.ID, type)
                }
            }
        }
    }

    override fun initView(view: View) {
        type = getArgumentInt(JumpConstants.ID)
        if (type == 2) {
            binding.Image2.setImageResource(R.mipmap.icon_rank11)
            binding.RankPhoto2.setImageResource(R.mipmap.icon_rank12)
            binding.RankPhoto3.setImageResource(R.mipmap.icon_rank13)
            binding.RankPhoto4.setImageResource(R.mipmap.icon_rank14)
            binding.RankPhoto5.setImageResource(R.mipmap.icon_rank15)
            binding.RankPhoto6.setImageResource(R.mipmap.icon_rank16)
            binding.RankPhoto7.setImageResource(R.mipmap.icon_rank17)
            binding.RankPhoto8.setImageResource(R.mipmap.icon_rank18)
            binding.UserName4.text = "格日勒"
            binding.UserName5.text = "阿尔善"
            binding.UserName6.text = "张二三"
            binding.UserName7.text = "新塔苏"
            binding.UserName8.text = "海日罕"
        }
    }
}